package com.xbts.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xbts.system.domain.CnCloudMarketSku;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 云市场规格Mapper接口
 * 
 * @author xbts
 * @date 2023-08-22
 */
public interface CnCloudMarketSkuMapper extends BaseMapper<CnCloudMarketSku> {

    /**
     * 查询云市场规格列表
     *
     * @param marketIds    云市场ids
     * @return 云市场规格集合
     */
    @Select("SELECT price,cloud_market_buying_method,market_id " +
            "FROM ( SELECT price,cloud_market_buying_method,market_id,first_sku_name,delete_flag FROM cn_cloud_market_sku ORDER BY price LIMIT 10000  ) a " +
            "where market_id in (${marketIds}) and delete_flag = false " +
            "GROUP BY market_id")
    List<CnCloudMarketSku> getLowerLevelSku(String marketIds);
}
